package club.janna.diveinspringboot.autoconfigure.bootstrap;

import club.janna.diveinspringboot.autoconfigure.service.CalculateService;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication(scanBasePackages = "club.janna.diveinspringboot.autoconfigure.service")
public class CalculateBootstrap {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder(CalculateBootstrap.class)
                .profiles("java7")
                .web(WebApplicationType.NONE)
                .run(args);
        CalculateService calculateService = context.getBean(CalculateService.class);
        System.out.println(calculateService.sum(0,1,2,3,4,5));
    }
}
